Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT debug agent using ASM #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ShaneKilloran
Copy link

This agent creates the hook needed to inject the code for running the JIT debug tool. See Readme for more information.

  • Uses ASM to alter bytecode of java.lang.reflect.Method and org.junit.rules.ExpectedException and inserts calls to debug tool

Closes r30shah/openj9-jit-debug-agent#3
Signed-off-by: Shane Killoran shanegkilloran@gmaill.com

-This agent creates the hook needed to inject the code for running the debug agent tool

Signed-off-by: Shane Killoran <shanegkilloran@gmail.com>
Signed-off-by: Shane Killoran <shanegkilloran@gmail.com>
@DanHeidinga
Copy link
Member

@ShaneKilloran this looks like a cool tool. Am I correct though that the base tool - the jit debug tool - lives in a non-openj9 repo? Would it be possible to have that tool contributed to openj9 first before working through this PR?

Are there limitations to this tool? In particular, the implementation of reflect is changing to use MethodHandles. Does that change how this tool needs to transform the bytecode?

@r30shah
Copy link

r30shah commented Dec 7, 2021

@ShaneKilloran this looks like a cool tool. Am I correct though that the base tool - the jit debug tool - lives in a non-openj9 repo? Would it be possible to have that tool contributed to openj9 first before working through this PR?

@DanHeidinga You are correct, this tool is requires some of the changes from the https://github.com/r30shah/openj9-jit-debug-agent that we needed to upstream after cleaning up. I am planning to open up an EPIC this week with the work to clean up and commit those changes as well as open up issues for couple of features which we could not get time this semester to work on but would make this tool more robust.

Are there limitations to this tool? In particular, the implementation of reflect is changing to use MethodHandles. Does that change how this tool needs to transform the bytecode?

I would let @ShaneKilloran / @qasimy123 to provide more insights about the limitations they have identified.

@ShaneKilloran
Copy link
Author

ShaneKilloran commented Dec 7, 2021

@DanHeidinga In response to your second question, yes the tool is limited. It depends upon the current implementation of Method.invoke() within reflect. If there are changes to this implementation than we'd need to update the tool to alter the bytecode appropriately.

Another limitation is that it is only functional with tests run through junit and does not currently support other testing frameworks, although we hope to add this in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write an instrumentation agent to modify JCL code
3 participants